﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CodeGeneratorBootstrap.Models;
using CodeGeneratorBootstrap.ClassServices;
using CodeGeneratorBootstrap.Generators;

namespace CodeGeneratorBootstrap.Models
{
    public class EventModel
    {
        public int Id { get; set; }
        public ClassModel ClassModel { get; set; }
        public string EventGroupName { get; set; }
        public string EventGroupColor { get; set; }
        public AttributeModel EventTitle { get; set; }
        public AttributeModel EventStart { get; set; }
        public AttributeModel EventEnd { get; set; }
        public AttributeModel FilterModel { get; set; }

        internal EventModel(EventModelDto dto)
        {
            Id = dto.Id;
            ClassModel = new ClassModel { Id = dto.ClassId };
            EventGroupName = dto.EventGroupName.Replace(" ", String.Empty);
            EventGroupColor = dto.EventGroupColor;
            EventTitle = new AttributeModel { Id = dto.EventTitle };
            EventStart = new AttributeModel { Id = dto.EventStart };
            EventEnd = new AttributeModel { Id = dto.EventEnd };
            FilterModel = new AttributeModel { Id = (dto.FilterModel == null) ? 0 : (int)dto.FilterModel };
        }

        public EventModel()
        {
            // TODO: Complete member initialization
        }

    }
}
